home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / CD32 / CD32_Support / examples / cdgsxl / Include / cdxl / cdxlob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-27  |  3.6 KB  |  151 lines

  1. /*************
  2.  
  3.  cdxlob.h
  4.  
  5.  W.D.L 930330
  6.  
  7. **************/
  8.  
  9. /*
  10.  * COPYRIGHT: Unless otherwise noted, all files are Copyright (c) 1993-1999
  11.  * Amiga, Inc.  All rights reserved.
  12.  *
  13.  * DISCLAIMER: This software is provided "as is".  No representations or
  14.  * warranties are made with respect to the accuracy, reliability, performance,
  15.  * currentness, or operation of this software, and all use is at your own risk.
  16.  * Neither Amiga nor the authors assume any responsibility or liability
  17.  * whatsoever with respect to your use of this software.
  18.  */
  19.  
  20. #ifndef    CDXLOB_H    // [
  21. #define    CDXLOB_H
  22.  
  23.  
  24. #define    BITMAP    struct BitMap
  25. #define    RECT    struct Rectangle
  26. #define    BUF_NUM    2
  27.  
  28. typedef int __asm (*PF)( register __a1 APTR, register __a2 struct CDXL *);
  29. typedef int (*PFI)( struct MinList * first, UBYTE * buf, ULONG len, PF code );
  30.  
  31. //typedef int __asm (*PF)( APTR, struct CDXL *);
  32. //typedef int (*PFI)( struct MinList * first, UBYTE * buf, ULONG len, PF code );
  33.  
  34. // CDXL control object
  35. typedef struct cdxl_ob
  36. {
  37.     UBYTE    * Buffer[BUF_NUM];
  38.     UBYTE    * Video[BUF_NUM];
  39.     UWORD    * CMap[BUF_NUM];
  40.     UBYTE    * audio[BUF_NUM];
  41.     ULONG       StartSector;
  42.     ULONG      NumSectors;
  43.     ULONG      NumFrames;
  44.     ULONG      flags;
  45.     ULONG      PlaneSize;
  46.     ULONG      ImageSize;
  47.     ULONG      AudioSize;
  48.     ULONG      FrameSize;
  49.     ULONG      BufSize;
  50.     ULONG      CMapSize;
  51.     ULONG      FibSize;
  52.     ULONG      KillSig;
  53.     ULONG      ReadXLSpeed;
  54.     RECT      rect;
  55.     BITMAP    bm[BUF_NUM];
  56.     SHORT      xoff,yoff;
  57.     BYTE      Volume;
  58.     BYTE      curAudio;
  59.     BYTE      curVideo;
  60.     BYTE      loops;
  61. } CDXLOB;
  62.  
  63. //CDXLDOB Flags
  64. #define    CDXL_BLIT        0x00000001
  65. #define    CDXL_MULTI_PALETTE    0x00000002
  66. #define    CDTV_DEVICE        0x00000004
  67. #define    CDXL_XLEEC        0x00000008
  68. #define    CDXL_DOSXL        0x00000010
  69.  
  70. #define    CDXL_RGB32        0x00000040
  71. #define    CDXL_PLAYING        0x00000100
  72. #define    CDXL_LMBABORT        0x10000000
  73. #define    CDXL_RMBABORT        0x20000000
  74. #define    CDXL_FIREABORT        0x40000000
  75. #define    CDXL_BUTTONABORTMASK    0x70000000
  76.  
  77.  
  78.  
  79. // Display definition and control structure
  80. typedef    struct DisplayDefinition
  81. {
  82.     SHORT              Left;
  83.     SHORT              Top;
  84.     SHORT              Width;
  85.     SHORT              Height;
  86.     SHORT              Depth;
  87.     SHORT              NominalWidth;
  88.     SHORT              NominalHeight;
  89.     ULONG              Flags;
  90.     ULONG              ModeID;
  91.     struct BitMap    * bm[2];
  92.     struct ViewPort    * vp;
  93.     struct DBufInfo * dbuf;
  94.  
  95. } DISP_DEF;
  96.  
  97. //DISP_DEF Flags
  98. #define        DISP_OVERSCAN        0x00000003
  99. #define        DISP_OVERSCANX        0x00000001
  100. #define        DISP_OVERSCANY        0x00000002
  101. #define        DISP_SCREEN        0x10000000
  102. #define        DISP_INTERLEAVED    0x20000000
  103. #define        DISP_ALLOCBM        0x40000000
  104. #define        DISP_BACKGROUND        0x80000000
  105. #define        DISP_XLPALETTE        0x01000000
  106. #define        DISP_NOPOINTER        0x02000000
  107. #define        DISP_XLMODEID        0x04000000
  108. #define        DISP_PATCH_OPENWB    0x08000000
  109.  
  110.  
  111.  
  112. // Use this when using cdtv.device instead of struct CDXL for cd.device
  113. typedef struct cdtv_cdxl
  114. {
  115.     struct    MinNode Node;    /* double linkage    */
  116.     char    *Buffer;    /* data (word aligned)    */
  117.     long    Length;        /* must be even # bytes    */
  118.     void    (*DoneFunc)();    /* called when done    */
  119.     long    Actual;        /* bytes transferred    */
  120.  
  121. } CDTV_CDXL;
  122.  
  123.  
  124.  
  125. //----
  126. #define SCREEN_WIDTH        640
  127. #define NTSC_HEIGHT        400
  128. #define PAL_HEIGHT        512
  129.  
  130. //----
  131. #define    SYSTEM_PAL        (GfxBase->DisplayFlags & REALLY_PAL)
  132. #define    CD_NAME            "cd.device"
  133. #define    CDTV_NAME        "cdtv.device"
  134. #define    CDTV_SEEK        10
  135. #define    CDTV_READXL        42
  136. #define    DEFAULT_XLSPEED    75
  137. #define    DEFAULT_SECTOR_SIZE    2048
  138. #define    DATA_TRANS_RATE        ((CDXL_ob->flags & CDTV_DEVICE) ? (DEFAULT_XLSPEED * DEFAULT_SECTOR_SIZE) : (cdinfo.ReadXLSpeed * cdinfo.SectorSize) )
  139.  
  140.  
  141. // Audio has different periods on NTSC vs PAL
  142. #define        NTSC_FREQ        3579545
  143. #define        PAL_FREQ        3546895
  144.  
  145. #define        INTDIV( a, b )        ( ( (a) + ( (b) / 2 ) ) / (b) )
  146. #define    MAX_CMAP    256
  147.  
  148. IMPORT    struct    CDInfo cdinfo;
  149.  
  150. #endif                // ]
  151.